<?php 
$userid = $this->session->userdata('user_id');
$query_user = $this->db->query("SELECT username, name,password,isPremium,entryDate,lastUpdated,avatar,lastUpdatedAvatar,gender, (SELECT SUM(rateValue)/COUNT(rateValue) FROM rating WHERE providerId = ".$userid." AND rateValue >0) AS rate, (SELECT COUNT(rateValue) FROM rating WHERE providerId = ".$userid." AND rateValue >0) AS voterCount FROM `user` WHERE `id` = '".$userid."'");
        $row_user = $query_user->row();
        $my_name = $row_user->name;

$isConfirm = 0;
$query = $this->db->query("SELECT COUNT(id) AS count FROM `confirm` WHERE idUser = ?",$userid);
                $row = $query->row();
                if($row->count > 0)                $isConfirm = 1;
?>

<?php

$bayar = array('T' => 'Tunai', 'P' => 'Poin');
$rating = array('1'=>'1', '2'=>'2', '3'=>'3' , '4'=>'4', '5' => '5');
$privacy = array('1' => 'Ya', '0' => 'Tidak');


function generate_input_x($type='', $array=array(), $name='', $sel='') {
    if ($type == 'radio') {
        foreach ($array as $key => $val) {
            echo '<label class="radio">';
            echo '<input data-toggle="radio" type="' . $type . '" name="' . $name . '" value="' . $key . '"/>' . $val . '&nbsp;';
            echo '</label>';
        }
    } else {
        foreach ($array as $key => $val) {
            echo '<input type="' . $type . '" name="' . $key . '" value="' . $key . '"/>' . $val . '&nbsp;';
        }
    }
}
?>
<link rel="stylesheet" type="text/css" href="jRating.jquery.css" media="screen" />
<!-- jQuery files -->
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jRating.jquery.js"></script>


<link href="assets/css/bootstrap.css" rel="stylesheet">
<link href="assets/css/bootstrap-responsive.css" rel="stylesheet">
<div class="page">
    <div class="container">
        <div class="span10 offset1" style="margin-top:20px;" id="wrap">
            <div class="container-fluid">
                <div class="row-fluid">

                    <div class="span4 thumbnail" id="profil-side">
                        <br/>
                      <!-- <img src="<?php echo base_url(); ?>avatar/thumb/<?php echo $output['avatar']; ?>" class="img-polaroid span10 offset1">   -->
                      <!-- start carousel -->
                      <div id="myCarousel" class="carousel slide span12">
                        <ol class="carousel-indicators">
                          <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
                          <li data-target="#myCarousel" data-slide-to="1"></li>
                        </ol>
                        <!-- Carousel items -->
                        <div class="carousel-inner">
                          <div class="active item" style="margin:auto;">
          <!-- <img src="images/image-002.jpg" /> -->
          <?php if($output['avatar'] != ""){ ?>
                            <img src="<?php echo base_url(); ?>avatar/thumb/<?php echo $output['avatar']; ?>" class="img-polaroid" onerror="this.src='<?php echo base_url(); ?>assets/img/person.jpg'" style="margin:auto;width:128px;height:128px;">
                            <?php } else { ?>
                            <img src="<?php echo base_url(); ?>/assets/img/person.jpg" class="img-polaroid" style="margin:auto;">
                            <?php } ?>
                            <div class="carousel-caption"><a href="<?php echo site_url(); ?>profil/avatar">ubah avatar</a></div> 
                          </div>
                          <div class="item" style="margin:auto;">
                            <?php if($output['avatarMotor'] != ""){ ?>
                            <img src="<?php echo base_url(); ?>motor/thumb/<?php echo $output['avatarMotor']; ?>" class="img-polaroid" onerror="this.src='<?php echo base_url(); ?>assets/img/icon_motorcycle.jpg'" style="margin:auto;width:128px;height:128px;">
                            <?php } else { ?>
                            <img src="<?php echo base_url(); ?>assets/img/icon_motorcycle.jpg" class="img-polaroid" style="margin:auto;">
                            <?php } ?>
                            <div class="carousel-caption"><a href="<?php echo site_url(); ?>profil/avatarMotor">ubah avatar motor</a></div>
                          </div>
                        </div>
                        <!-- Carousel nav -->
                        <a class="car-control left" href="#myCarousel" data-slide="prev"><img src="<?php echo base_url(); ?>assets/img/arrow_left_blue.png" style="width:30px;height:30px;" /></a>
                        <a class="car-control right" href="#myCarousel" data-slide="next"><img src="<?php echo base_url(); ?>assets/img/arrow_right_blue.png" style="width:30px;height:30px;" /></a>
                      </div>
                      <!-- end carousel -->
                      <?php if($output['id'] == $id) { ?>   
                      <!-- <div class="text-center"><a href="<?php echo site_url(); ?>profil/avatar">ubah avatar</a></div>
                      <div class="text-center"><a href="<?php echo site_url(); ?>profil/avatarMotor">ubah avatar motor</a></div> -->
                      <?php } ?>
                      <div class="text-center">
                      <?php
                          for($x=1;$x<=$output['rate'];$x++) { ?>
                              <?php if($output['id'] != $id){ ?>
                                <a href="<?php echo site_url(); ?>rating/addRating/<?php echo $output['id']; ?>?rateValue=<?php echo $x; ?>">
                                <?php
                                //echo '<a href="'.$x.'" data-toggle="tooltip" data-placement="bottom" title="Rate '.$x.'">';
                                echo '<img height="25" width="25" src="'.base_url().'assets/img/ic_rating_full.png" />';
                                echo '</a>';
                              } else {
                                echo '<img height="25" width="25" src="'.base_url().'assets/img/ic_rating_full.png" />';
                              }
                          }
                          if (strpos($output['rate'],'.')) { ?>
                            <?php if($output['id'] != $id){ ?>
                              <a href="<?php echo site_url(); ?>rating/addRating/<?php echo $output['id']; ?>?rateValue=<?php echo $x; ?>">
                              <?php
                              //echo '<a href="'.$x.'" data-toggle="tooltip" data-placement="bottom" title="Rate '.$x.'">';
                              echo '<img height="25" width="25" src="'.base_url().'assets/img/ic_rating-half.png" />';
                              echo '</a>';
                              $x++;
                              } else {
                                echo '<img height="25" width="25" src="'.base_url().'assets/img/ic_rating-half.png" />';
                              }
                          }
                          while ($x<=5) { ?>
                          <?php if($output['id'] != $id){ ?>
                              <a href="<?php echo site_url(); ?>rating/addRating/<?php echo $output['id']; ?>?rateValue=<?php echo $x; ?>">
                              <?php
                             //echo '<a href="'.$x.'" data-toggle="tooltip" data-placement="bottom" title="Rate '.$x.'">';
                              echo '<img height="25" width="25" src="'.base_url().'assets/img/ic_rating-not.png" />';
                              echo '</a>';
                              
                            } else {
                              echo '<img height="25" width="25" src="'.base_url().'assets/img/ic_rating-not.png" />';
                            }
                            $x++;
                          } 
                      ?>
                      ( <?php echo $output['voterCount']; ?> )
                      </div>
                      
                      <div class="text-center"><?php echo $output['deliverCounter']; ?> kali diantar</div>   
                      <div class="text-center">mulai berbagi sejak <?php echo nicetime($output['entryDate']);?></div> <br/>
                      <div class="text-left offset1"><strong>DESKRIPSI:</strong></div>   
                      <div class="text-left offset1"><?php echo $output['bio']; ?></div>   <br/>
                      <div class="text-left offset1"><strong>PENGGUNA 
                        <?php 
                          if($output['isPremium'] == 1){
                            echo 'PREMIUM';
                          } else if($output['isPremium'] == 2){
                            echo 'SEMI-PREMIUM'; ?>
                            <?php if(!$isConfirm){ ?>
                            <a href="<?php echo site_url().'profil/confirm/'.$output['id'];?>">Konfirmasi pembayaran</a> 
                            <?php } else {?>
                            (menunggu persetujuan admin)
                            <?php } ?>
                        <?php } else {
                            echo 'GRATIS'; ?> 
                            <?php if($output['id'] == $id) { ?>    
                            <br/><a href="<?php echo site_url().'profil/premium/'.$output['id'];?>">Go premium?</a>                       
                            <?php  } ?>
                        <?php  } ?>
                      </strong></div>  <br/> 
                      <div class="text-left offset1">
                        <?php if($userid == $output['id']){ ?>                          
                          <a href="<?php echo site_url('profil/edit/'.$output['id']); ?>" class="btn btn-warning" id="kirim">EDIT PROFIL</a>
                        <?php } else { ?>
                          <a href="#popKirimPesan" data-toggle="modal" class="btn btn-warning" id="kirim">KIRIM PESAN</a><br/>
                          <!-- <a href="#popKomentar" data-toggle="modal" class="btn btn-warning" id="kirim">TAMBAH RATING DAN KOMENTAR</a> -->
                        <?php
                        }

                        ?>                        
                      </div>       
                      
                    </div><br/>
                    <div class="span8">
                      <div class="row-fluid span12">                        
                        <div class=""><h4><?php echo strtoupper($output['name']); ?>
                          <?php if($id != $this->uri->segment(3) and $output['currentTrip']){ 
                                  if($output['currentTrip'][0]['status']=='P'){?> 
                          - (PENGEMUDI)</h4>
                          <?php } else { ?>
                          - (PENUMPANG)</h4>
                          <?php }} ?>
                        </div>
                      </div>
                      <div class="row-fluid span12 thumbnail" id="profil-side">
                        <?php if($id == $this->uri->segment(3)){?>
                        <?php if(!$output['currentTrip']){ ?>
                        Kamu belum posting perjalanan apapun. yuk buat :) <a href="<?php echo site_url('perjalanan'); ?>"><i class="icon-pencil offset11"></i></a>
                        <?php } else if($output['currentTrip'][0]['status']=='P'){ ?>
                        <div class="span10"> 
                          Saya mau berangkat dari 
                          <?php echo $output['currentTrip'][0]['source_label']; ?> ke <?php echo $output['currentTrip'][0]['destination_label']; ?>
                          pada                            
                          <?php echo $output['currentTrip'][0]['departTime'];?>
                          <?php if($output['currentTrip'][0]['via'] != "") { ?>
                          via <?php echo $output['currentTrip'][0]['via']; ?> 
                          <?php } ?>, 
                          <?php echo $output['currentTrip'][0]['notes'];?>
                        </div>
                        <div class="span2">
                          <?php echo change_number($output['currentTrip'][0]['priceInRupiah']); ?> <br/>
                          <?php echo $output['currentTrip'][0]['priceInPoint']; ?> poin
                        </div>
                        <div class="span offset10">                       
                        <a href="<?php echo site_url().'perjalanan/edit/'.$output['id'];?>"><i class="icon-edit"></i></a> 
                        <a href="<?php echo site_url().'perjalanan/hapus/'.$output['currentTrip'][0]['id'];?>"><i class="icon-remove"></i></a>
                        </div>
                        <!--
                        <script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
<script type="text/javascript">stLight.options({publisher: "96051c9b-f5a9-4dae-a921-63b4393f763a", doNotHash: false, doNotCopy: false, hashAddressBar: true});</script>
                         <span class='st_facebook_large' displayText='Facebook'></span> -->
                        <!-- <span class='st_twitter_large' displayText='Tweet'></span>  -->
                        <a href="https://twitter.com/share" class="twitter-share-button" data-text="Saya akan melakukan perjalanan dari <?php echo $output['currentTrip'][0]['source_label']; ?> ke <?php echo $output['currentTrip'][0]['destination_label']; ?> pada <?php echo $output['currentTrip'][0]['departTime']; ?>, mau ikut? :)" data-lang="id">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
                        <?php } else {
                          //echo 'saya mau nebeng'; ?>
                          <div class="span10"> 
                          Saya mencari tumpangan dari 
                          <?php echo $output['currentTrip'][0]['source_label']; ?> ke <?php echo $output['currentTrip'][0]['destination_label']; ?>
                          pada                            
                          <?php echo $output['currentTrip'][0]['departTime'];?>
                          <?php if($output['currentTrip'][0]['via'] != "") { ?>
                          via <?php echo $output['currentTrip'][0]['via']; ?> 
                          <?php } ?>, 
                          <?php echo $output['currentTrip'][0]['notes'];?>
                        </div>
                        <div class="span2">
                          <?php echo change_number($output['currentTrip'][0]['priceInRupiah']); ?> <br/>
                          <?php echo $output['currentTrip'][0]['priceInPoint']; ?> poin
                        </div>
                        <div class="span offset10">                       
                        <a href="<?php echo site_url().'perjalanan/edit/'.$output['id'];?>"><i class="icon-edit"></i></a> 
                        <a href="<?php echo site_url().'perjalanan/hapus/'.$output['currentTrip'][0]['id'];?>"><i class="icon-remove"></i></a>
                        </div>
                        <?php } 

                        } else { ?>
                        <?php if($output['currentTrip'] != "" and $output['currentTrip'][0]['status']=='P'){?>                        

                          <!-- <div class="row-fluid span12" id="profil-side"> --> <!-- baris tiap riwayat-->
                           <div class="row-fluid span12" id="profil-side">
                        <div class="span10"> 
                          Saya mau berangkat dari 
                          <?php echo $output['currentTrip'][0]['source_label']; ?> ke <?php echo $output['currentTrip'][0]['destination_label']; ?>
                          pada                            
                          <?php echo $output['currentTrip'][0]['departTime'];?>
                          <?php if($output['currentTrip'][0]['via'] != "") { ?>
                          via <?php echo $output['currentTrip'][0]['via']; ?> 
                          <?php } ?>, <br/>
                          <?php echo $output['currentTrip'][0]['notes'];?>
                        </div>
                        <div class="span2">
                          <?php echo change_number($output['currentTrip'][0]['priceInRupiah']); ?> <br/>
                          <?php echo $output['currentTrip'][0]['priceInPoint']; ?> poin
                        </div>
                        <br/>
                      <!-- </div> --> <!-- end baris tiap riwayat-->
                        </div> 
                          <?php if($output['currentTrip'][0]['status']=='P'){?>
                          <?php if($output['pickUpStatus']=='A'){?>
                          <div class="row-fluid span2 offset8" id="profil-side">
                          <a href="#popJemputSaya" data-toggle="modal" class="btn btn-warning" id="jemput">JEMPUT SAYA</a>
                          </div>
                          <?php } else { ?>
                          <?php 
                            $query_tran = $this->db->query("SELECT id FROM transaction WHERE providerId = ? and userId = ?",array($output['id'],$this->session->userdata('user_id')));
                            $row_tran = $query_tran->row();
                            $idTransaction = $row_tran->id;
                            //echo 'id transaksi: '.$idTransaction.'<br/>';
                          ?>
                          <div class="row-fluid span2 offset8" id="profil-side">
                          <!-- <a href="<?php echo site_url();?>/transaction/cancelTransactionUser/<?php echo $idTransaction;?>" data-toggle="" class="btn btn-warning" id="jemput">BATALKAN PERJALANAN</a> -->
                          <div class="btn btn-warning">SEDANG ADA PERJALANAN</div>
                          </div>
                          <?php } ?><?php } ?>
                          <?php } else {
                            //echo 'saya mau nebeng'; ?>
                            <div class="span10"> 
                          Saya mencari tumpangan dari 
                          <?php echo $output['currentTrip'][0]['source_label']; ?> ke <?php echo $output['currentTrip'][0]['destination_label']; ?>
                          pada                            
                          <?php echo $output['currentTrip'][0]['departTime'];?>
                          <?php if($output['currentTrip'][0]['via'] != "") { ?>
                          via <?php echo $output['currentTrip'][0]['via']; ?> 
                          <?php } ?>, 
                          <?php echo $output['currentTrip'][0]['notes'];?>
                        </div>
                        <div class="span2">
                          <?php echo change_number($output['currentTrip'][0]['priceInRupiah']); ?> <br/>
                          <?php echo $output['currentTrip'][0]['priceInPoint']; ?> poin
                        </div>

                            <?php } ?>
                        <?php }?>
                      </div>
                      
                      <div class="row-fluid span12">
                        <br/>
                        <div class=""><strong>RIWAYAT PERJALANAN</strong></div><br/>
                      </div>                                        
                        <!-- <div class="row-fluid span12 thumbnail" id="profil-side"> --> <!-- baris tiap riwayat-->
                        <?php 
                        if($output['history']){
                        for($count=0;$count<sizeof($output['history']);$count++){ ?>
                        
                        <div class="row-fluid span12 thumbnail" id="profil-side">
                        <div class="span2">
                          <div class="thumbnail ava">
                            <?php if($output['history'][$count]['avatar']!= ""){ ?> 
                            <img data-src="<?php echo base_url(); ?>assets/js/holder.js/160x120" src="<?php echo base_url(); ?>avatar/thumb/<?php echo $output['history'][$count]['avatar'];?>" class="" onerror="this.src='<?php echo base_url(); ?>assets/img/person.jpg'">

                            <?php } else { ?>
                            <img data-src="<?php echo base_url(); ?>assets/js/holder.js/160x120" src="<?php echo base_url(); ?>assets/img/person.jpg" class="">
                            <?php } ?>
                          </div>
                        </div>
                        <div class="span8"> 
                          <strong><?php echo $output['history'][$count]['source_label']; ?> -> <?php echo $output['history'][$count]['destination_label']; ?></strong> <br/>
                          via <?php echo (isset($output['history'][$count]['via'])?$output['history'][$count]['via']:'-'); ?> <br/>
                          <a href="<?php echo site_url().'profil/detail/'.$output['history'][$count]['userId'];?>">
                          <?php echo $output['history'][$count]['name'] ?> 
                          </a> &nbsp;
                          <?php echo $output['history'][$count]['departTime']; ?>
                        </div>
                        <div class="span2">
                          <?php echo change_number($output['history'][$count]['price']); ?> <br/>
                        </div>
                      </div></a>
                        <br/>
                        <?php  }} else {
                          echo '<div class="row-fluid span12 thumbnail" id="profil-side">';
                          echo 'Belum ada riwayat perjalanan';
                          echo '</div>';
                        }
                      ?>
                     <!--  </div>  --><!-- end baris tiap riwayat-->
                      <?php if($output["viewMoreHistory"]=="true"){ ?>
                      <a href="#"><div class="text-right">Lihat semua >></div> </a>
                      <?php } ?>
                      <div class="row-fluid span12">
                        <br/>
                        <div class=""><strong>KOMENTAR</strong></div><br/>
                      </div>
                      
                          
                            <?php 
                        if($output['comments']){
                        for($count=0;$count<sizeof($output['comments']);$count++){ ?>
                        
                        <div class="row-fluid span12 thumbnail" id="profil-side">
                        <div class="span2">
                          <div class="thumbnail ava">
                            <?php if($output['comments'][$count]['avatar']!= ""){ ?>
                            <img data-src="<?php echo base_url(); ?>assets/js/holder.js/160x120" src="<?php echo base_url(); ?>avatar/thumb/<?php echo $output['comments'][$count]['avatar'];?>" class="" onerror="this.src='<?php echo base_url(); ?>assets/img/person.jpg'">

                            <?php } else { ?>
                            <img data-src="<?php echo base_url(); ?>assets/js/holder.js/160x120" src="<?php echo base_url(); ?>assets/img/person.jpg" class="">
                            <?php } ?>
                          </div>
                        </div>
                        <div class="span10"> 
                          <a href="<?php echo site_url().'profil/detail/'.$output['comments'][$count]['reviewerId'];?>">
                          <strong><?php echo $output['comments'][$count]['name']; ?> </strong>
                          </a>, 25/05/2013 <br/>
                          <?php echo $output['comments'][$count]['comment']; ?> 
                        </div>
                        </div>
                        <br/><br/>
                        <?php  }} else {
                          echo '<div class="row-fluid span12 thumbnail" id="profil-side">';
                          echo 'Belum ada komentar';
                          echo '</div>';
                        }
                      ?>
                      
                      <?php if($output["viewMoreComments"]=="true"){ ?>
                      <a href="#"><div class="text-right">Lihat semua >></div> </a>
                      <?php } ?>
                      <?php if($output['id'] != $id){?>
                      <div class="row-fluid span12 thumbnail">
                      <form action="<?php echo site_url(); ?>rating/addComment/<?php echo $output['id']; ?>" method="POST">
                        <textarea name="comment" placeholder="Silakan tulis komentar Anda di sini..."></textarea>
                        <input type="submit" class="btn btn-warning offset10" value="POST"/>
                      </form>
                    </div>
                      <?php } ?>
                    </div><br/>
                </div><br/>
      <!-- Modal -->
        <div id="popJemputSaya" class="span4 modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
                <h4 id="myModalLabel">FORM PEMBAYARAN</h4>
            </div>
            <form method="POST" action="<?php echo site_url('transaction');?>">
                <div class="modal-body">
                  <div class="row">
                    <div class="span4">Nama Lengkap: <?php echo $my_name; ?></div>
                  </div>
                  <div class="row">
                    <div class="span4">Dari: <?php echo $output['currentTrip'][0]['source_label']; ?></div>
                  </div>
                  <div class="row">
                    <div class="span4">Ke: <?php echo $output['currentTrip'][0]['destination_label']; ?></div>
                  </div>
                  <div class="row">
                    <div class="span4">Pengemudi: <?php echo $output['name']; ?></div>
                  </div>
                  <div class="row">
                    <div class="span4">Metode Pembayaran:</div>
                      <div class="span4">        
                        <?php generate_input_x('radio',$bayar,'paymentMethod'); ?>
                      </div>
                  </div>
                  <div class="row">
                    <div class="span4">Poin:  <?php echo $output['currentTrip'][0]['priceInPoint']; ?></div>
                  </div>
                  <div class="row">
                    <div class="span4">Sembunyikan Riwayat:</div>
                      <div class="span4">        
                        <?php generate_input_x('radio',$privacy,'privacy'); ?>
                      </div>
                  </div>
                  <input class="" type="hidden" name="providerId" value="<?php echo $output['id']; ?>" />
                  <input class="" type="hidden" name="idTrip" value="<?php echo $output['currentTrip'][0]['id']; ?>" />                  
                  <input class="" type="hidden" name="price" value="<?php echo $output['currentTrip'][0]['priceInRupiah']; ?>" />
                  <input class="" type="hidden" name="departTime" value="<?php echo $output['currentTrip'][0]['departTime'];?>" />
                  <input class="" type="hidden" name="source_label" value="<?php echo $output['currentTrip'][0]['source_label'];?>" />
                  <input class="" type="hidden" name="destination_label" value="<?php echo $output['currentTrip'][0]['destination_label'];?>" />
                    <input type="submit" value="KIRIM" class="span3 offset2 btn btn-warning" />
                </div>
            </form>
        </div><!-- end modal -->
        <!-- Modal -->
        <div id="popKirimPesan" class="span4 modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
                <h4 id="myModalLabel">KIRIM PESAN</h4>
            </div>
            <form method="POST" action="<?php echo site_url('pesan/send_message/'.$output['id']);?>">
                <div class="modal-body">
                  <div class="row">
                    <div class="span4">Kepada: <?php echo $output['name']; ?></div>
                  </div>
                  
                  <div class="row">
                    <div class="span4">Isi Pesan:</div>                      
                  </div>
                  <div class="row">
                    <textarea name="body" class="span4" style="margin-left:10px;"></textarea>
                  </div>
                  <input class="" type="hidden" name="recipient" value="<?php echo $output['id']; ?>" />
                   <input type="submit" value="KIRIM" class="span3 offset2 btn btn-warning" />
                </div>
            </form>
        </div><!-- end modal -->
        <!-- Modal -->
        <div id="popKomentar" class="span4 modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
                <h4 id="myModalLabel">Tambah Rating dan Komentar</h4>
            </div>
            <form method="POST" action="<?php echo site_url('rating/add/'.$output['id']);?>">
                <div class="modal-body">
                  <div class="row">
                    <div class="span4">Kepada: <?php echo $output['name']; ?></div>
                  </div>
                  <div class="row">
                    <div class="span4">Rating: </div>
                    <div class="span4">        
                        <?php generate_input_x('radio',$rating,'rateValue'); ?>
                      </div>
                  </div>                  
                  <div class="row">
                    <div class="span4">Komentar:</div>                      
                  </div>
                  <div class="row">
                    <textarea name="comment" class="span4"></textarea>
                  </div>
                  <input class="" type="hidden" name="recipient" value="<?php echo $output['id']; ?>" />
                   <input type="submit" value="KIRIM" class="span3 offset2 btn btn-primary" />
                </div>
            </form>
        </div><!-- end modal -->
    </div>
            </div>
        </div>
    </div>
</div>
